﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DataSetEsquemaAppCeiiTableAdapters;

/// <summary>
/// Descripción breve de ListaMatBLL
/// </summary>
public class ListaMatBLL
{
	public ListaMatBLL(){}

    private LISTA_MATERIAL_PRESTAMOTableAdapter _lAdapter = null;
    protected LISTA_MATERIAL_PRESTAMOTableAdapter Adapter
    {
        get
        {
            if (_lAdapter == null)
                _lAdapter = new LISTA_MATERIAL_PRESTAMOTableAdapter();

            return _lAdapter;
        }
    }
    //seleccionar elementos de tabla considera
    [System.ComponentModel.DataObjectMethodAttribute
    (System.ComponentModel.DataObjectMethodType.Select, true)]
    public DataSetEsquemaAppCeii.LISTA_MATERIAL_PRESTAMODataTable select(int mat_id,int carta_id)
    {
        return Adapter.GetDataByIDS(mat_id,carta_id);
    }
    [System.ComponentModel.DataObjectMethodAttribute
    (System.ComponentModel.DataObjectMethodType.Delete, true)]
    public int delete(int mat_id,int carta_id)
    {
        int filas_afectadas = Adapter.Delete(mat_id, carta_id);
        if (filas_afectadas == 0) return 0;
        else return 1;
    }
    [System.ComponentModel.DataObjectMethodAttribute
    (System.ComponentModel.DataObjectMethodType.Update, true)]
    public int update(int cant, int mat_id, int carta_id)
    {
        decimal a1 = mat_id;
        decimal a2 = carta_id;
        int filas_afectadas = Adapter.Update(cant, a1, a2);
        if (filas_afectadas == 0) return 0;
        else return 1;
    }
}
